home *** CD-ROM | disk | FTP | other *** search
/ Atari Mega Archive 2 / Atari Mega Archive CD - Volume 2.iso / minix / up1510b.tgz / up1510b / include / amoeba.h < prev    next >
C/C++ Source or Header  |  1990-07-19  |  3KB  |  101 lines

  1. #ifndef _AMOEBA_H
  2. #define _AMOEBA_H
  3.  
  4. /****************************************************************************/
  5. /*                                        */
  6. /* (c) Copyright 1988 by the Vrije Universiteit, Amsterdam, The Netherlands */
  7. /*                                        */
  8. /*    This product is part of the  Amoeba  distributed operating system.    */
  9. /*                                        */
  10. /*    Permission to use, sell, duplicate or disclose this software must be  */
  11. /* obtained in writing.  Requests for such permissions may be sent to        */
  12. /*                                        */
  13. /*                                        */
  14. /*        Dr. Andrew S. Tanenbaum                        */
  15. /*        Dept. of Mathematics and Computer Science            */
  16. /*        Vrije Universiteit                        */
  17. /*        Postbus 7161                            */
  18. /*        1007 MC Amsterdam                        */
  19. /*        The Netherlands                            */
  20. /*                                        */
  21. /****************************************************************************/
  22.  
  23. /*
  24. ** If the host operating system for amoeba transactions is not amoeba
  25. ** then several things may need to be done to make the amoeba code
  26. ** compatible.  These are provided in host_os.h.
  27. */
  28. #include "host_os.h"
  29.  
  30. #define PORTSIZE     6
  31. #define OOBSIZE        20
  32. #define HEADERSIZE    32
  33. #define PRIVSIZE    10
  34. #define CAPSIZE        16
  35.  
  36. #define FAIL        ((unshort) -1)
  37. #define NOTFOUND    ((unshort) -2)
  38. #define BADADDRESS    ((unshort) -3)
  39. #define ABORTED        ((unshort) -4)
  40. #define TRYAGAIN    ((unshort) -5)
  41.  
  42. #define sizeoftable(t)    (sizeof(t) / sizeof((t)[0]))
  43.  
  44. #define NILPORT        ((port *) 0)
  45. #define NILBUF        ((bufptr) 0)
  46.  
  47. #define _FP(p)        ((struct _fakeport *) (p))
  48. #ifndef lint
  49. #define PortCmp(p, q)    (_FP(p)->_p1==_FP(q)->_p1 && _FP(p)->_p2==_FP(q)->_p2)
  50. #define NullPort(p)    (_FP(p)->_p1==0L && _FP(p)->_p2==0)
  51. #else
  52. #define PortCmp(p, q)    ((p)->_portbytes[0] == (q)->_portbytes[0])
  53. #define NullPort(p)    ((p)->_portbytes[0] == 0)
  54. #endif
  55.  
  56. typedef char *bufptr;
  57. #ifndef MAX_BLOCK_NR
  58. typedef unsigned short unshort;
  59. #endif
  60. typedef char *event_t;
  61.  
  62. typedef struct {
  63.     char    _portbytes[PORTSIZE];
  64. } port;
  65.  
  66. struct _fakeport {
  67.     long    _p1;
  68.     short    _p2;
  69. };
  70.  
  71. typedef struct {    /* private part of capability */
  72.     char    prv_object[3];
  73.     char    prv_rights;
  74.     port    prv_random;
  75. } private;
  76.  
  77. typedef struct {
  78.     port    cap_port;
  79.     private    cap_priv;
  80. } capability;
  81.  
  82. typedef struct {
  83.     port    h_port;
  84.     port    h_signature;
  85.     private    h_priv;
  86.     unshort    h_command;
  87.     long    h_offset;
  88.     unshort    h_size;
  89.     unshort    h_extra;
  90. } header;
  91.  
  92. #define h_status    h_command    /* alias: reply status */
  93.  
  94. /*
  95. ** Some function declarations that people tend to forget
  96. ** because they are lazy.
  97. */
  98. extern unshort trans(), getreq(), putrep(), timeout();
  99.  
  100. #endif /* _AMOEBA_H */
  101.